package com.mofang.activity.user;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

import com.mofang.R;
import com.mofang.activity.BaseTitleViewActiviey;

public class UserCenterActivity extends BaseTitleViewActiviey implements OnClickListener {

	private LinearLayout ll_user_center_userSetting;
	private LinearLayout ll_user_center_commission;
	private LinearLayout ll_user_center_bankAccount;
	private LinearLayout ll_user_center_customerFeedback;
	private LinearLayout ll_user_center_customerRegistration;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		setContentView(R.layout.activity_user_center);
		super.onCreate(savedInstanceState);
		setNavigationTitle("用户中心");
	}

	@Override
	protected void initView() {
		super.initView();
		ll_user_center_userSetting = (LinearLayout) findViewById(R.id.ll_user_center_userSetting);
		ll_user_center_commission = (LinearLayout) findViewById(R.id.ll_user_center_commission);
		ll_user_center_bankAccount = (LinearLayout) findViewById(R.id.ll_user_center_bankAccount);
		ll_user_center_customerFeedback = (LinearLayout) findViewById(R.id.ll_user_center_customerFeedback);
		ll_user_center_customerRegistration = (LinearLayout) findViewById(R.id.ll_user_center_customerRegistration);
	}

	@Override
	protected void setListener() {
		super.setListener();
		ll_user_center_userSetting.setOnClickListener(UserCenterActivity.this);
		ll_user_center_commission.setOnClickListener(UserCenterActivity.this);
		ll_user_center_bankAccount.setOnClickListener(UserCenterActivity.this);
		ll_user_center_customerFeedback
				.setOnClickListener(UserCenterActivity.this);
		ll_user_center_customerRegistration
				.setOnClickListener(UserCenterActivity.this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.user_center, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		Intent intent = new Intent();

		switch (v.getId()) {
		case R.id.ll_user_center_userSetting:
			intent.setClass(UserCenterActivity.this, UserSettingActivity.class);
			break;
		case R.id.ll_user_center_commission:
			intent.setClass(UserCenterActivity.this, MyCommissionActivity.class);
			break;
		case R.id.ll_user_center_bankAccount:
			intent.setClass(UserCenterActivity.this,
					MyBankAccountActivity.class);
			break;
//		case R.id.ll_user_center_informCustomer:
//			intent.setClass(UserCenterActivity.this,
//					InformCustomerActivity.class);
//			break;
		case R.id.ll_user_center_customerFeedback:
			intent.setClass(UserCenterActivity.this,
					CustomerFeedBackActivity.class);
			break;
		case R.id.ll_user_center_customerRegistration:
			intent.setClass(UserCenterActivity.this,
					CustomerRegistrationActivity.class);
			break;
		default:
			break;
		}
		startActivity(intent);
	}

}
